package org.theqcp.wow.sim.gui.tabs;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;

import org.theqcp.wow.sim.gui.DataPoint;
import org.theqcp.wow.sim.gui.EnhSimGUIFrame;

public class Shaman extends DataPanel {

    private static final long serialVersionUID = 4792401348284742842L;

    protected final String[] PlayerRaces = new String[] { "Draenei", "Orc", "Tauren", "Troll" };

    protected final String[] mainHandStats = new String[] { "MH speed", "MH dps", "MH crit %", "MH hit %",
	    "MH expertise" };
    protected final String[] offHandStats = new String[] { "OH speed", "OH dps", "OH crit %", "OH hit %",
	    "OH expertise" };
    protected final String[] otherStats = new String[] { "Attack power", "Haste %", "Armor pen %", "Strength",
	    "Agility", "Intelligence", "Spirit", "Spellpower", "Spell crit %", "Spell hit %", "Max mana", "Mp5" };

    public Shaman(EnhSimGUIFrame esgFrame) {
	fieldNames.put("Race", DataPoint.race);
	fieldNames.put("MH speed", DataPoint.mh_speed);
	fieldNames.put("MH dps", DataPoint.mh_dps);
	fieldNames.put("MH crit %", DataPoint.mh_crit);
	fieldNames.put("MH hit %", DataPoint.mh_hit);
	fieldNames.put("MH expertise", DataPoint.mh_expertise_rating);
	fieldNames.put("OH speed", DataPoint.oh_speed);
	fieldNames.put("OH dps", DataPoint.oh_dps);
	fieldNames.put("OH crit %", DataPoint.oh_crit);
	fieldNames.put("OH hit %", DataPoint.oh_hit);
	fieldNames.put("OH expertise", DataPoint.oh_expertise_rating);
	fieldNames.put("Attack power", DataPoint.ap);
	fieldNames.put("Haste %", DataPoint.haste);
	fieldNames.put("Armor pen %", DataPoint.armor_penetration);
	fieldNames.put("Strength", DataPoint.str);
	fieldNames.put("Agility", DataPoint.agi);
	fieldNames.put("Intelligence", DataPoint.Int);
	fieldNames.put("Spirit", DataPoint.spi);
	fieldNames.put("Spellpower", DataPoint.spellpower);
	fieldNames.put("Spell crit %", DataPoint.spell_crit);
	fieldNames.put("Spell hit %", DataPoint.spell_hit);
	fieldNames.put("Max mana", DataPoint.max_mana);
	fieldNames.put("Mp5", DataPoint.mp5);

	setupPanel(esgFrame);
    }

    private void setupPanel( EnhSimGUIFrame esgFrame ) {
	setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
	setBorder(new TitledBorder("Shaman"));

	add(makeComboBox(esgFrame, "Race", PlayerRaces));

	{ // Main hand
	    JPanel mainHand = makeTextFieldArray(esgFrame, mainHandStats);
	    mainHand.setBorder(new TitledBorder("Main hand"));
	    add(mainHand);
	}

	{ // Off hand
	    JPanel offHand = makeTextFieldArray(esgFrame, offHandStats);
	    offHand.setBorder(new TitledBorder("Off hand"));
	    add(offHand);
	}

	{ // Other things
	    JPanel others = makeTextFieldArray(esgFrame, otherStats);
	    others.setBorder(BorderFactory.createTitledBorder("Others"));
	    add(others);
	}
    }

}